﻿@model VisaApp.Models.ChauLucModel
@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestCategoeyChauLuc"
    };
}

<script type="text/javascript">

    function completedAjaxRequestCategoeyChauLuc(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {
            if (returnObj.Message != null) {
                makeSuccessHighlightChauLuc(returnObj.Message);
            }
            else if (returnObj.RedirectUrl != null) {
                window.location.href = returnObj.RedirectUrl;
            }
        } else {
            makeErrorHighlightChauLuc(returnObj.Message);
        }

        return false;
    }

    function makeErrorHighlightChauLuc(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span><strong>Alert: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }

    function makeSuccessHighlightChauLuc(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span><strong>Success: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }

    $(document).ready(function () {
        $(".rich-text").cleditor({ width: 496, height: 400, useCSS: true });
        $("#tabasAddCategory").tabs();

    });

</script>
@using (Ajax.BeginForm("EditChauLuc", "Quantri", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    <div class="section-header">
        <div class="options">
            <button type="submit" name="save" value="save" class="t-button">
                Save</button>
        </div>
    </div>
    <div id="tabasAddCategory">
        <ul>
            <li><a href="#tabs-1">Thông tin</a></li>
            <li><a href="#tabs-2">Seo</a></li>
        </ul>
        <div id="tabs-1">
            <table>
                <tr>
                    <td colspan="2">
                        @Html.HiddenFor(model => model.Id, new { id = "Id" })
                        @Html.HiddenFor(model => model.DateCreate)
                        @Html.HiddenFor(model => model.Detele)
                        <div class="warning-area">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Name, "Tên châu lục"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.Name, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.Name)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.regioncode, "Region Code"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.regioncode, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.regioncode)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Description, " Mô tả ngắn "):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.Description, new { @class="rich-text", @style = "width:300px; height:80px" })
                        @Html.ValidationMessageFor(model => model.Description)
                    </td>
                </tr>
                 <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.clat, " Địa chỉ clat "):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.clat, new { @class = "rich-text", @style = "width:300px; height:80px" })
                        @Html.ValidationMessageFor(model => model.clat)
                    </td>
                </tr>
                 <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.clong, " Địa chỉ clong "):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.clong, new { @class = "rich-text", @style = "width:300px; height:80px" })
                        @Html.ValidationMessageFor(model => model.clong)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Status, "Trạng thái hiển thị"):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(x => x.Status)
                        @Html.ValidationMessageFor(model => model.Status)
                    </td>
                </tr>
            </table>
        </div>
        <div id="tabs-2">
            <table>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.MetaTitle, "Meta Title"):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.MetaTitle, new { @style = "width:300px; height:50px" })
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Keywork, "Meta keywrok"):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.Keywork, new { @style = "width:300px; height:50px" })
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.metaDescription, " Meta Description"):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.metaDescription, new { @style = "width:300px; height:100px" })
                    </td>
                </tr>
            </table>
        </div>
    </div>
    
}
